package org.example.bifunction;

import java.util.function.BiFunction;
import java.util.function.Function;

public class Java8BiFunction2b {
    public static void main(String[] args) {
        String result = powToString(2, 3, (a, b) -> Math.pow(a,b), aDouble -> "result:" + aDouble);
        System.err.println(result);
    }

    public static <R> R powToString(Integer a1, Integer a2, BiFunction<Integer,Integer,Double> func, Function<Double,R> func1){
        return func.andThen(func1).apply(a1,a2);
    }
}
